package com.dome.client.entity.po;

import com.baomidou.mybatisplus.annotations.TableField;
import com.baomidou.mybatisplus.annotations.TableId;
import com.baomidou.mybatisplus.enums.FieldFill;
import com.baomidou.mybatisplus.enums.FieldStrategy;
import com.baomidou.mybatisplus.enums.IdType;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import com.gitee.sunchenbin.mybatis.actable.annotation.Column;
import com.gitee.sunchenbin.mybatis.actable.annotation.IsAutoIncrement;
import com.gitee.sunchenbin.mybatis.actable.annotation.IsKey;
import lombok.Getter;
import lombok.Setter;

import java.io.Serializable;
import java.util.Date;

@Setter
@Getter
public class BaseEntity implements Serializable {


    private static final long serialVersionUID = 5015645982500701329L;

    @TableId(value = "id",type = IdType.AUTO)
    @Column(name = "id",comment = "主键")
    @IsKey
    @IsAutoIncrement
    @JsonSerialize(using = ToStringSerializer.class)
   // @TableId(type = IdType.ID_WORKER)
    private Long id;

    @Column(name = "create_user_id",comment = "创建用户ID")
    @TableField(value="create_user_id",fill = FieldFill.INSERT,strategy = FieldStrategy.NOT_EMPTY)
    private Long createUserId;

    @Column(name = "create_user_name",comment = "创建用户名称")
    @TableField(value="create_user_name",fill = FieldFill.INSERT,strategy = FieldStrategy.NOT_EMPTY)
    private String createUserName;

    @Column(name = "update_user_id",comment = "更新用户ID")
    @TableField(value="update_user_id",fill = FieldFill.INSERT,strategy = FieldStrategy.NOT_EMPTY)
    private Long updateUserId;

    @Column(name = "update_user_name",comment = "更新人")
    @TableField(value="update_user_name",fill = FieldFill.INSERT,strategy = FieldStrategy.NOT_EMPTY)
    private String updateUserName;

    @Column(name = "create_time",comment = "创建时间")
    @TableField(value="create_time",fill = FieldFill.INSERT,strategy = FieldStrategy.NOT_EMPTY)
    private Date createTime;

    @Column(name = "update_time",comment = "更新时间")
    @TableField(value="update_time",fill = FieldFill.INSERT,strategy = FieldStrategy.NOT_EMPTY)
    private Date updateTime;

    @Column(name = "is_valid",comment = "是否有效")
    @TableField(value="is_valid",fill = FieldFill.INSERT,strategy = FieldStrategy.IGNORED)
    private Integer isValid;

    @Column(name = "version",comment = "版本")
    @TableField(value="version",fill = FieldFill.INSERT,strategy = FieldStrategy.IGNORED)
    private Integer version;

}
